<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2021/9/8
  Time: 15:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/common.jsp"%>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-3">
            <div id="tree"></div>
        </div>
        <div class="col-lg-9">
                <div class="tabbable">
                    <ul class="nav nav-tabs" id="myTab">
                    </ul>
                    <div class="tab-content">

                    </div>
                </div>
        </div>
    </div>
</div>
</body>
<html>
<head>
    <link href="#" rel="shortcut icon"/>
    <title>东东后台管理</title>
    <style>
        .iframeClass{
        height:800px !important;
        }
    </style>
</head>
</html>
<script type="text/javascript">
    function getTree() {
        var tree = [];
        $.ajax({
            url:"<%=path%>/menu/getInfo",
            dataType:"json",
            type:"post",
            async:false,
            success:function (result){
                tree = result;
            },
            error:function (result){
                toastr.error("递归遍历失败")
            }
        })
        return tree;
    }
    $('#tree').treeview({
        data: getTree(),
        borderColor: "blue",
        onNodeSelected:function (event,data){
            if (data.nodes == undefined){
                $.addtabs.add({
                    title:data.text,
                    url:"<%=path%>/"+data.url,
                    id:data.id,
                })
            }
        }
    });
</script>

